
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="/static/bootstrap-5.1.3-dist/css/bootstrap.css">
    <script type="text/javascript" src="/static/bootstrap-5.1.3-dist/js/bootstrap.js"></script>
    <title>订单详情</title>
</head>
<style>
    .back{
        position: absolute;
        font-size: 26px;
        top:30px;
        left:40px;
        text-decoration: none;
        color: #000;
        font-weight: bold;
    }
    .back:hover{
        color: #000;
    }

    h2{
        text-align: center;
        margin-top: 15px;
    }

    .card{
        width: 1400px;
        height: 700px;
        background-color: #fffdfd;
        border-radius: 30px;
        border: none;
        box-shadow: 5px 5px 10px #adabab;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        margin: auto;
    }

    .mod{
        padding: 30px 300px;
    }
    .mb-3{
        padding-bottom: 30px;
    }

    table {
        text-align: center;
        vertical-align: middle !important;
        word-wrap:break-all;
        word-break:break-all;
        table-layout:fixed;

        width: 90% !important;
        margin-left: 80px;

    }
    h4{
        text-align: center;
        margin-bottom: 10px;
    }

    .page {
        height: 50px;
        /*width: 1270px;*/
        /*margin-left: 1400px;*/
        position: fixed;
        bottom: 150px;
        right: 200px;
    }

</style>
<body>
<a href="${pageContext.request.contextPath}/my_orders" class="back">
    <span><</span>返回</a>
<h2>订单详情</h2>
<div class="card">
    <form class="mod">
        <div class="mb-3 row">
            <label for="staticRef" class="col-sm-2 col-form-label">订单号</label>
            <div class="col-sm-10">
                <input type="text" readonly class="form-control-plaintext" id="staticRef" value="${order.ref}">
            </div>
        </div>
        <div class="mb-3 row">
            <label for="staticDate" class="col-sm-2 col-form-label">消费日期</label>
            <div class="col-sm-10">
                <input type="text" readonly class="form-control-plaintext" id="staticDate" value="${order.date}">
            </div>
        </div>
        <div class="mb-3 row">
            <label for="staticPrice" class="col-sm-2 col-form-label">订单商品总价</label>
            <div class="col-sm-10">
                <input type="text" readonly class="form-control-plaintext" id="staticPrice" value="${order.price}">
            </div>
        </div>
<%--        <div>订单号:${order.ref}</div>--%>
<%--        <div>消费日期:${order.date}</div>--%>
<%--        <div>订单商品总价格为：${order.price}</div>--%>
    </form>

    <h4>订单详细条目</h4>
    <table id="order" class="table table-bordered table-striped">

        <thead>
        <tr>
            <th>序号</th>
            <th>商品名称</th>
            <th>商品单价</th>
            <th>购买数量</th>
            <th>该商品总价格</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${itemsList}" var="items" varStatus="s">
            <c:forEach items="${goodsList}" var="goods" varStatus="s1">
                <c:if test="${items.goodid == goods.id}">
                    <tr>
                        <td>${s.index+1}</td>
                        <td>${goods.name}</td>
                        <td>${goods.price}</td>
                        <td>${items.good_cnt}</td>
                        <td>${items.price}</td>
                    </tr>
                </c:if>
            </c:forEach>
        </c:forEach>
        </tbody>
    </table>

    <div class="page">
        <nav aria-label="Page navigation example">
            <ul class="pagination justify-content-between">
                <c:if test="${pageInfo.isLast && falg == null}">
                    <li><a href="order_show?page=${pageInfo.pageIndex-1}&orderid=${order.id}" class="page-link"><span
                            aria-hidden="true">&larr;</span> 上一页</a></li>
                </c:if>
                <c:if test="${pageInfo.isNext && falg == null}">
                    <li><a href="order_show?page=${pageInfo.pageIndex+1}&orderid=${order.id}" class="page-link">下一页 <span
                            aria-hidden="true">&rarr;</span></a></li>
                </c:if>

            </ul>
            <span>第 ${pageInfo.pageIndex} 页/共 ${pageInfo.sumCount} 页</span>
        </nav>
    </div>

</div>

</body>
</html>